import sqlite3


def getHot():
    newlist = []

    conn = sqlite3.connect(r"../news.db")  # 表示上一级目录下面的文件
    cur = conn.cursor()
    #浏览量最高的十条新闻
    sql = "select url,title,views from newsInfo order by views desc limit 10"
    new = cur.execute(sql)
    for item in new:
        data = []
        data.append(item[0])
        data.append(item[1])
        data.append(item[2])
        #\u200b是不可见字符，trim()无法去掉，要用replace
        newlist.append(data)

    return newlist

getHot()


